package com.sample.wanandroidx.support

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.sample.library.util.NetWorkUtil

import org.greenrobot.eventbus.EventBus

class NetworkChangeReceiver : BroadcastReceiver() {

    override fun onReceive(context: Context, intent: Intent) {
        val isConnected = NetWorkUtil.isNetworkConnected(context)
        EventBus.getDefault().post(OnNetworkChangeEvent(isConnected))
    }

}